package main

import (
    "google.golang.org/grpc"
    //"gowork/gatewayGrpc/helper"
    "gowork/gatewayGrpc/grpcServer/services"
    "net"
)

func main() {

    //creds := helper.GetServerCreds() //这里这个方法取到的是服务端证书配置
    rpcServer := grpc.NewServer()
    services.RegisterProdServiceServer(rpcServer, new(services.ProdService))
    services.RegisterOrderServiceServer(rpcServer, new(services.ProdService))

    lis, _ := net.Listen("tcp", ":7429")
    rpcServer.Serve(lis)

    // mux:=http.NewServeMux()
    // mux.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
    //     rpcServer.ServeHTTP(writer,request)
    // })
    // httpServer:=&http.Server{
    //    Addr:":8081",
    //    Handler:mux,
    // }
    // httpServer.ListenAndServeTLS("keys/server.crt","keys/server.key")
		
    // protoc --go_out=plugins=grpc:. --validate_out=lang=go:. models
}